USE [influenza]
GO
/****** Object:  StoredProcedure [dbo].[SP_listaEstados]    Script Date: 03/09/2010 14:05:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[SP_listaEstados]
@param varchar(3)
as
Begin
--select entidad, nombre from Catalogos.dbo.entidad
SELECT DISTINCT LEFT(l.nEntidad,2) AS identidad,
	   c.nombre as nombre,
	   c.entidad as entidad
FROM [influenza].[dbo].[Cat_Laboratorio] l,
	 [catalogos].[dbo].[entidad] c
WHERE l.nEntidad = c.entidad
ORDER BY c.nombre
End